/**
Http Server powered by express
*/
/**
* Modult depandence
*/
var app = require('express')();
var httpServer = require('http').Server(app);
var router = require('./router')(app);
//var sio = require('socket.io')(httpServer);
var config = require(./config);

/**
* Module exports.
*/
module.exports = Server;


/**
*  Server functions
*/


//Init rcserver object
function Server(){
  this.version = '0.1.0';
  console.log('Server construction.');    
}

Server.prototype.start = function(){
   //set server route
   //console.log(router.version);
   router.initRouter();
   httpServer.listen(config.port);
   console.log('HIC server start at %s.',config.port);
};

